/*

class Solution {
public:

    void postorder(TreeNode* root, vector<int>& vi)
    {
        if (root == nullptr)
            return;
        postorder(root->left, vi);
        postorder(root->right, vi);
        vi.push_back(root->val);
    }

    vector<int> postorderTraversal(TreeNode* root) {
        vector<int> vi;
        postorder(root, vi);
        return vi;
    }
};


class Solution {
public:
    int bitSum(int n)
    {
        int sum = 0;
        while (n)
        {
            int tmp = n % 10;
            n /= 10;
            sum += tmp * tmp;
        }
        return sum;
    }

    bool isHappy(int n) {
        int slow = n, fast = bitSum(n);
        while (slow != fast){
            slow = bitSum(slow);
            fast = bitSum(bitSum(fast));
        }
        return fast == 1;
    }
};


class Solution {
public:
    int maxArea(vector<int>& height) {
        int maxSum = -1;
        for (int left = 0, right = height.size() - 1; left < right;)
        {
            int Sum = (right - left) * min(height[left], height[right]);
            maxSum = Sum > maxSum ? Sum : maxSum;
            if (height[left] >= height[right])
                right--;
            else
                left++;
        }
        return maxSum;
    }
};

*/